<?php
	//Made by Chao Xu(Mgccl) of http://www.webdevlogs.com
	//version 0.1
class filter{
static function ini($image, $data){
	$name = (string) $data['name'];
	filter::$name($image,$data);
}


static function rgb_inverse($image){
	imagefilter($image, IMG_FILTER_NEGATE);
}


static function rgb_grayscale($image){
	imagefilter($image, IMG_FILTER_GRAYSCALE);
}

static function rgb_edgedetect($image){
	imagefilter($image, IMG_FILTER_EDGEDETECT);
}

static function gaussian_blur($image){
	imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
}

static function selective_blur($image){
	imagefilter($image, IMG_FILTER_SELECTIVE_BLUR);
}

static function emboss($image){
	imagefilter($image, IMG_FILTER_EMBOSS);
}

static function mean_removal($image){
	imagefilter($image, IMG_FILTER_MEAN_REMOVAL);
}

static function smooth($image,$data){
	imagefilter($image, IMG_FILTER_SMOOTH, (int)$data['value']);
}

static function colorize($image, $data){
	imagefilter($image, IMG_FILTER_COLORIZE, (int)$data['r'], (int)$data['g'], (int)$data['b']);
}


static function contrast($image, $data){
	magefilter($image, IMG_FILTER_CONTRAST, (int)$data['value']);
}

static function brightness($image, $data){
	imagefilter($image, IMG_FILTER_BRIGHTNESS, (int)$data['value']);
}
}
?>